package com.warrior.entity;

import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;

/**
 * <p>
 * DB WorkerID Assigner for UID Generator
 * </p>
 *
 * @author lqh
 * @since 2020-05-22
 */
@TableName("worker_node")
public class WorkerNode extends Model<WorkerNode> {

    private static final long serialVersionUID = 1L;

    /**
     * auto increment id
     */
    @TableId(value = "ID", type = IdType.AUTO)
    private Long id;
    /**
     * host name
     */
    @TableField("HOST_NAME")
    private String hostName;
    /**
     * ip
     */
    @TableField("IP")
    private String ip;
    /**
     * port
     */
    @TableField("PORT")
    private String port;
    /**
     * user.dir
     */
    @TableField("DIR")
    private String dir;
    /**
     * node type: ACTUAL or CONTAINER
     */
    @TableField("TYPE")
    private Integer type;
    /**
     * launch date
     */
    @TableField("LAUNCH_DATE")
    private Date launchDate;
    /**
     * modified time
     */
    @TableField("MODIFIED")
    private Date modified;
    /**
     * created time
     */
    @TableField("CREATED")
    private Date created;


    public Long getId() {
        return id;
    }

    public WorkerNode setId(Long id) {
        this.id = id;
        return this;
    }

    public String getHostName() {
        return hostName;
    }

    public WorkerNode setHostName(String hostName) {
        this.hostName = hostName;
        return this;
    }

    public String getIp() {
        return ip;
    }

    public WorkerNode setIp(String ip) {
        this.ip = ip;
        return this;
    }

    public String getPort() {
        return port;
    }

    public WorkerNode setPort(String port) {
        this.port = port;
        return this;
    }

    public String getDir() {
        return dir;
    }

    public WorkerNode setDir(String dir) {
        this.dir = dir;
        return this;
    }

    public Integer getType() {
        return type;
    }

    public WorkerNode setType(Integer type) {
        this.type = type;
        return this;
    }

    public Date getLaunchDate() {
        return launchDate;
    }

    public WorkerNode setLaunchDate(Date launchDate) {
        this.launchDate = launchDate;
        return this;
    }

    public Date getModified() {
        return modified;
    }

    public WorkerNode setModified(Date modified) {
        this.modified = modified;
        return this;
    }

    public Date getCreated() {
        return created;
    }

    public WorkerNode setCreated(Date created) {
        this.created = created;
        return this;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "WorkerNode{" +
        "id=" + id +
        ", hostName=" + hostName +
        ", ip=" + ip +
        ", port=" + port +
        ", dir=" + dir +
        ", type=" + type +
        ", launchDate=" + launchDate +
        ", modified=" + modified +
        ", created=" + created +
        "}";
    }
}
